package edu.ynu.se.xiecheng.achitectureclass.controller;

import edu.ynu.se.xiecheng.achitectureclass.dto.DataDTO;
import edu.ynu.se.xiecheng.achitectureclass.service.SoilTemperatureService;
import edu.ynu.se.xiecheng.achitectureclass.service.SoilWaterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/SoilWater")
public class SoilWaterController {

    @Autowired
    private SoilWaterService soilWaterService;

    @GetMapping("/tenSoilWaterdata")
    public List<DataDTO> getSoilWaterData() {
        return soilWaterService.findLatestTenSoilWaterData();
    }

}
